<?php

namespace app\api\controller\bookshelf;

use app\api\controller\Controllers;
use app\api\service\Books as BooksService;

class books extends Controllers
{
    /**
     * 显示资源列表
     *
     * @return \think\Response
     */
    public function index(int $sid, BooksService $service)
    {
        return $service->booksBySidebar($sid);
    }

    /**
     * 显示书籍详情
     *
     * @return \think\Response
     */
    public function read( int $id, BooksService $service )
    {
        return $service->read($id);
    }

    /**
     * 查询搜索范围
     *
     * @return \think\Response
     */
    public function search(string $search, BooksService $service)
    {
        return $service->search( $search );
    }

}